//
//  CKBackTextFieldButton.m
//  GIFShow
//
//  Created by 陈凯 on 15/6/2.
//  Copyright (c) 2015年 CK. All rights reserved.
//

#import "CKBackTextFieldButton.h"

@implementation CKBackTextFieldButton


-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {

        _contentTextField = [[UITextField alloc]initWithFrame:CGRectMake(38, 2.5, frame.size.width - 110, 30)];
        [self configSubviews];
    }
    
    return self;
}
-(void)configSubviews{
    self.backgroundColor = [UIColor colorWithWhite:0.9 alpha:0.9];
    _contentTextField.borderStyle = UITextBorderStyleRoundedRect;
    [self addSubview:self.contentTextField];
    [self addSubview:self.backButton];
    [self addSubview:self.submitButton];
}
-(void)setPalceholderStr:(NSString *)palceholderStr{

    _contentTextField.placeholder =[[NSString alloc]initWithString:palceholderStr];

}
-(UIButton *)backButton{
    if (_backButton == nil) {
        _backButton = [UIButton buttonWithType:UIButtonTypeSystem];
        _backButton.frame = CGRectMake(2.5, 2.5, 30, 30);
        [_backButton setImage:[UIImage imageNamed:@"tabfanhui"] forState:UIControlStateNormal];
    }
    return _backButton;
}
-(UIButton *)submitButton{
    if (_submitButton == nil) {
        _submitButton = [UIButton buttonWithType:UIButtonTypeSystem ];
        _submitButton.frame = CGRectMake(self.frame.size.width - 63, 2.5, 60, 30);
        [_submitButton setTitle:@"评论" forState:UIControlStateNormal];
        _submitButton.layer.cornerRadius =3;
        _submitButton.layer.borderColor = [UIColor colorWithRed:0.08 green:0.4 blue:1 alpha:0.9].CGColor;
        _submitButton.layer.borderWidth = 0.5;
    }
    return _submitButton;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
